<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>测试服务</title>
	</head>
	<body>
		<button onclick="send()">发送</button>
		<button onclick="list()">请求列表</button>
		<button onclick="list1()">请求列表1</button>
		<button onclick="delete1()">删除1</button>
		<form action="http://localhost/upload/fastDFSUpload" method="post" enctype="multipart/form-data" >
			<input type="file" name="file" id="" value="" />
			<input type="submit" id="" name="" value="提交" />
		</form>
		<script src="js/jquery-1.9.1.min.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript">
			// /group1/M00/00/00/tEyz013k-LOAePZlAAKni1Qk_PU663.jpg
           // jQuery.support.cors = true;
		    var str = JSON.stringify({'path':'D:/sss', 'fileName':'t.txt','size':'300kb','uploadBy':'whp','suffix':'txt'} );
			var str1 = JSON.stringify({'path':'D:/sss', 'fileName':'www111.txt','size':'300kb','uploadBy':'chm','suffix':'txt'} );
			var str2 = JSON.stringify({'path':'D:/sss', 'fileName':'www.txt','size':'300kb','uploadBy':'www','suffix':'img'} );
			console.log(str);
			function xx(){
				console.log(2222);
			}
			function send(){
				console.log(1111);
				$.ajax({
					url: 'http://localhost/api/file/save',
					// url: 'http://localhost/api/file/list',
					type: 'post',
					// type: 'get',
					contentType : "application/json;",
					data:str1,
					success:function (res) {
						console.log(res);
					}
				})
			}
			function list() {
				$.ajax({
					url: 'http://localhost/api/file/list',
					type: 'get',
					data:{
						// uploader: "www",
						fileType: 'txt',
						fileName: 't'
					},
					success:res => {
						console.log(res);
					}
					
				})
			}
			function list1() {
				$.ajax({
					url: 'http://localhost/api/file/selectList',
					type: 'get',
					data:{
						uploader: "chm",
						fileType: 'txt',
						fileName: 't'
					},
					success:res => {
						console.log(res);
					}
					
				})
			}
			function delete1() {
				$.ajax({
					url: 'http://localhost/upload/fastDFSDownload',
					type: 'get',
					data:{
						filePath:'/group1/M00/00/00/tEyz013k-LOAePZlAAKni1Qk_PU663.jpg'
						},
					success:res => {
						console.log(res);
					}
					
				})
			}
			
		</script>
	</body>
</html>
